//
//  YSExperienceOrderDetailHeaderView.m
//  Yueshi
//
//  Created by Northwan on 15/8/5.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSExperienceOrderDetailHeaderView.h"
#import "YSBusinessCtrl.h"

@interface YSExperienceOrderDetailHeaderView()

@property (weak, nonatomic) IBOutlet UILabel *orderNumLabel;
@property (weak, nonatomic) IBOutlet UILabel *orderStatusLabel;
@property (weak, nonatomic) IBOutlet UILabel *orderTimeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *supplierIconView;
@property (weak, nonatomic) IBOutlet UILabel *supplierNameLabel;
@end

@implementation YSExperienceOrderDetailHeaderView

+(instancetype)headerView{
    return [[[NSBundle mainBundle]loadNibNamed:@"YSExperienceOrderDetailHeaderView" owner:nil options:nil]lastObject];
}
- (IBAction)openBussiness:(id)sender {
    NSInteger supplierId =  _order.supplierId;
    YSBusinessCtrl *ctrl =  [[YSBusinessCtrl alloc]initWithSupplierId:supplierId];
    [self.viewController.navigationController pushViewController:ctrl animated:YES];
}

-(void)setOrder:(YSOrder *)order{
    _order = order;
    [self.orderNumLabel setText:order.orderCode];
    [self.orderStatusLabel setText:order.orderStatusName];
    [self.orderTimeLabel setText:order.orderCreateTime];
    [self.supplierIconView setImageURLStr:order.logo];
    [self.supplierNameLabel setText:order.supplierName];
}

@end
